
import api from '../fetch/api.js'

const actions = {
    /**
     * （学生端）API/根据USERID获取我发的建议列表
     * @param {*} param0
     * @param {*} params {userId}
     */
    async getEventByUserId({commit, rootState}, params) {
        return await api.mineBaseMsgApi(rootState.Host + '/itfer-qkfy/rest/student/getEventByUserId/' + params.userId)
    },
    /**
     * （学生端）API/获取反映类型列表
     * @param {*} param0
     */
    async getEventTypeList({commit, rootState}, params) {
        return await api.mineBaseMsgApi(rootState.Host + '/itfer-qkfy/rest/student/getEventTypeList', params)
    },
    /**
     * （学生端）API/发布建言献策
     * @param {*} param0
     */
    async getAddEvent({commit, rootState}, params) {
        return await api.minePostMsgApi(rootState.Host + '/itfer-qkfy/rest/student/addEvent', params)
    },
    /**
     * （全部）API/根据建议ID获取建议详情 获取建议流程
     * @param {*} param0
     */
    async getEventByEventId({commit, rootState}, params) {
        return await api.mineBaseMsgApi(rootState.Host + '/itfer-qkfy/rest/student/getEvent/' + params.userId + '/' + params.event_id)
    },
    /**
     * API/评价建议
     * @param {*} param0
     */
    async addComment({commit, rootState}, params) {
        return await api.minePostMsgApi(rootState.Host + '/itfer-qkfy/rest/student/addComment', params)
    }
}

export default actions
